home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / lib / udev / lmt-udev < prev    next >
Encoding:
Text File  |  2012-05-20  |  539 b   |  26 lines

  1. #!/bin/sh -e
  2. # /usr is not guaranteed to be mounted when udev starts
  3.  
  4. (
  5.     if [ -e /lib/udev/hotplug.functions ]; then
  6.         . /lib/udev/hotplug.functions
  7.         wait_for_file /usr/sbin/laptop_mode
  8.         exec /usr/sbin/laptop_mode "$@"
  9.     else
  10.         local file=$1
  11.         local timeout=$2
  12.         [ "$timeout" ] || timeout=120
  13.  
  14.         local count=$timeout
  15.         while [ $count != 0 ]; do
  16.             [ -e "/usr/sbin/laptop_mode" ] && exec /usr/sbin/laptop_mode "$@" && return 0
  17.             sleep 1
  18.             count=$(($count - 1))
  19.         done
  20.  
  21.         mesg "$file did not appear before the timeout!"
  22.         exit 1
  23.     fi
  24.  
  25. ) &
  26.